package com.mongodb.server;

import com.mongodb.entity.User;
import com.mongodb.dao.IUserDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author Conceit
 * @version 1.0, 2017/1/9
 */
@Service("userServerImpl")
public class UserServerImpl implements IUserServer {

    @Resource
    IUserDao userDaoImpl;


    public List<User> findByEmail(String email) {
        return userDaoImpl.findByEmail(email);
    }

    public User findOneByUserId(String userId) {
        return userDaoImpl.findOneByUserId(userId);
    }

    public void saveUser(User user) {
        userDaoImpl.saveUser(user);
    }

    public List<User> findAllUserByName(String name) {
        return userDaoImpl.findAllUserByName(name);
    }

    public List<User> findUsersByTime(Date startTime, Date endTime) {
        return userDaoImpl.findUsersByTime(startTime, endTime);
    }


}
